package com.smartreader.model;

import com.github.pagehelper.PageInfo;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
/**
 * @Author: JunYunXiao
 * @Date: 2024/12/11 11:06
 * @Description:
 */
@Setter
@Getter
public class Page<T> {
    /**
     * 当前⻚码
     */
    private int pageNum;
    /**
     * 每⻚条数
     */
    private int pageSize;
    /**
     * 数据载体
     */
    private List<T> list;
    /**
     * 总条数
     */
    private long total;
    public Page(int pageNum, int pageSize, List<T> list) {
        PageInfo pageInfo = new PageInfo(list);
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.list = list;
        this.total = pageInfo.getTotal();
    }
}
